package com.gali.lovefinder.common;

/**
 * 错误码
 *
 * @author gali
 */
public enum ErrorCode {

    SUCCESS(0, "ok", ""),
    PARAMS_ERROR(40000, "请求参数错误", ""),
    NULL_ERROR(40001, "请求数据为空", ""),
    NOT_LOGIN(40100, "未登录", ""),
    NO_AUTH(40101, "无权限", ""),
    SYSTEM_ERROR(50000, "系统内部异常", ""),
    SAVE_ERROR(50010, "新增失败", ""),
    UPDATE_ERROR(50020, "更新失败", ""),
    DELETE_ERROR(50030, "删除失败", ""),
    USER_ALREADY_EXISTS(50040, "用户已存在", ""),
    USER_NOT_EXISTS(50050, "用户不存在", ""),
    PASSWORD_OR_USER_COUNT_ERROR(50060, "账号或密码错误", ""),
    MESSAGE_CODE_EXISTS(60040, "验证码未过期", ""),
    MESSAGE_SEND_ERROR(60050, "验证码发送失败", ""),
    MESSAGE_CODE_NOT_EXISTS(60060, "验证码不存在", ""),
    MESSAGE_CODE_ERROR(60060, "验证码输入错误", ""),
    EMAIL_FORMAT_ERROR(60070, "邮箱格式错误", ""),
    TRY_REDISSON_LOCK_ERROR(70060, "尝试加锁失败", ""),
    SPRING_CTX_GET_ERROR(70070, "获取上下文失败", "");
    private final int code;

    /**
     * 状态码信息
     */
    private final String message;

    /**
     * 状态码描述（详情）
     */
    private final String description;

    ErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getDescription() {
        return description;
    }
}
